home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
051-060
/
amok52
/
gadgeted
/
txt
/
req2.mod
< prev
next >
Wrap
Text File
|
1993-11-04
|
14KB
|
556 lines
IMPLEMENTATION MODULE Req2;
(* Erstellen einer Gadget-Struktur *)
FROM SYSTEM IMPORT ADR,ADDRESS;
FROM Intuition IMPORT NewWindow, WindowPtr, IDCMPFlags, IDCMPFlagSet,
WindowFlags, WindowFlagSet, ScreenFlags,
ScreenFlagSet, OpenWindow, CloseWindow,
customScreen, Gadget, IntuiText, Border,
StringInfo, PropInfo, GadgetFlagSet,
GadgetFlags, ActivationFlags, AddGList,
ActivationFlagSet, boolGadget, strGadget,
propGadget, PropInfoFlagSet, PropInfoFlags,
RefreshGList;
FROM Graphics IMPORT jam1, jam2;
TYPE XYTyp = ARRAY [0..9] OF INTEGER;
BufTyp = ARRAY [0..255] OF CHAR;
VAR GadgWindow : NewWindow;
WPtr : WindowPtr;
Pos : INTEGER;
Gadgets : ARRAY [0..7] OF Gadget;
Borders : ARRAY [0..10] OF Border;
XY : ARRAY [0..10] OF XYTyp;
GText : ARRAY [0..7] OF IntuiText;
SInfo : ARRAY [0..4] OF StringInfo;
Buf : ARRAY [0..4] OF BufTyp;
UBuf : BufTyp;
PROCEDURE InitReq2
(VAR wptr : ADDRESS;
Screen : ADDRESS;
Title : ADDRESS);
(* Aufbau der Gadget-Struktur im Window *)
BEGIN
(* Window aufbauen *)
(*-----------------*)
IF (wptr = NIL) THEN
WITH GadgWindow DO
leftEdge := 110; topEdge := 41;
width := 409; height := 135;
detailPen := 0; blockPen := 1;
idcmpFlags := IDCMPFlagSet{gadgetDown,gadgetUp,closeWindow};
flags := WindowFlagSet{windowDrag,windowDepth,
windowClose,activate};
firstGadget := ADR(Gadgets[0]);
checkMark := NIL;
title := Title;
screen := Screen;
bitMap := NIL;
minWidth := 30; minHeight := 20; maxWidth := 640; maxHeight := 256;
IF (Screen # NIL) THEN
type := customScreen;
ELSE
type := ScreenFlagSet{wbenchScreen};
END; (*IF*)
END; (*WITH*)
END; (*IF*)
(*--------------------------------------------------------------------------*)
(* Aufbau der Gadget-Strukturen *)
(*------------------------------*)
WITH Gadgets[0] DO
nextGadget := ADR(Gadgets[1]);
leftEdge := 296;
topEdge := 115;
width := 67;
height := 9;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := boolGadget;
gadgetRender := ADR(Borders[0]);
selectRender := NIL;
gadgetText := ADR(GText[0]);
specialInfo := NIL;
gadgetID := 0;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[0] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := 25; topEdge := 1;
iTextFont := NIL;
iText := ADR('OK');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[0] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[0]);
nextBorder := ADR(Borders[1]);
END; (*WITH*)
XY[0,0] := 0; XY[0,1] := 0;
XY[0,2] := 70; XY[0,3] := 0;
XY[0,4] := 70; XY[0,5] := 12;
XY[0,6] := 0; XY[0,7] := 12;
XY[0,8] := 0; XY[0,9] := 0;
WITH Borders[1] DO
leftEdge := -5; topEdge := -4;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[1]);
nextBorder := NIL;
END; (*WITH*)
XY[1,0] := 0; XY[1,1] := 0;
XY[1,2] := 76; XY[1,3] := 0;
XY[1,4] := 76; XY[1,5] := 16;
XY[1,6] := 0; XY[1,7] := 16;
XY[1,8] := 0; XY[1,9] := 0;
(*-------------------------------------------------------*)
WITH Gadgets[1] DO
nextGadget := ADR(Gadgets[2]);
leftEdge := 43;
topEdge := 115;
width := 67;
height := 9;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := boolGadget;
gadgetRender := ADR(Borders[2]);
selectRender := NIL;
gadgetText := ADR(GText[1]);
specialInfo := NIL;
gadgetID := 1;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[1] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := 9; topEdge := 1;
iTextFont := NIL;
iText := ADR('CANCEL');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[2] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[2]);
nextBorder := ADR(Borders[3]);
END; (*WITH*)
XY[2,0] := 0; XY[2,1] := 0;
XY[2,2] := 70; XY[2,3] := 0;
XY[2,4] := 70; XY[2,5] := 12;
XY[2,6] := 0; XY[2,7] := 12;
XY[2,8] := 0; XY[2,9] := 0;
WITH Borders[3] DO
leftEdge := -5; topEdge := -4;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[3]);
nextBorder := NIL;
END; (*WITH*)
XY[3,0] := 0; XY[3,1] := 0;
XY[3,2] := 76; XY[3,3] := 0;
XY[3,4] := 76; XY[3,5] := 16;
XY[3,6] := 0; XY[3,7] := 16;
XY[3,8] := 0; XY[3,9] := 0;
(*-------------------------------------------------------*)
WITH Gadgets[2] DO
nextGadget := ADR(Gadgets[3]);
leftEdge := 159;
topEdge := 115;
width := 91;
height := 9;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := boolGadget;
gadgetRender := ADR(Borders[4]);
selectRender := NIL;
gadgetText := ADR(GText[2]);
specialInfo := NIL;
gadgetID := 2;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[2] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := 5; topEdge := 1;
iTextFont := NIL;
iText := ADR('VIELLEICHT');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[4] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[4]);
nextBorder := ADR(Borders[5]);
END; (*WITH*)
XY[4,0] := 0; XY[4,1] := 0;
XY[4,2] := 94; XY[4,3] := 0;
XY[4,4] := 94; XY[4,5] := 12;
XY[4,6] := 0; XY[4,7] := 12;
XY[4,8] := 0; XY[4,9] := 0;
WITH Borders[5] DO
leftEdge := -5; topEdge := -4;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[5]);
nextBorder := NIL;
END; (*WITH*)
XY[5,0] := 0; XY[5,1] := 0;
XY[5,2] := 100; XY[5,3] := 0;
XY[5,4] := 100; XY[5,5] := 16;
XY[5,6] := 0; XY[5,7] := 16;
XY[5,8] := 0; XY[5,9] := 0;
(*-------------------------------------------------------*)
WITH Gadgets[3] DO
nextGadget := ADR(Gadgets[4]);
leftEdge := 162;
topEdge := 22;
width := 219;
height := 8;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := strGadget ;
gadgetRender := ADR(Borders[6]);
selectRender := NIL;
gadgetText := ADR(GText[3]);
specialInfo := ADR(SInfo[0]);
gadgetID := 3;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[3] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := -139; topEdge := 0;
iTextFont := NIL;
iText := ADR('Name');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[6] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[6]);
nextBorder := NIL;
END; (*WITH*)
XY[6,0] := 0; XY[6,1] := 0;
XY[6,2] := 222; XY[6,3] := 0;
XY[6,4] := 222; XY[6,5] := 11;
XY[6,6] := 0; XY[6,7] := 11;
XY[6,8] := 0; XY[6,9] := 0;
(* String-Info *)
WITH SInfo[0] DO
buffer := ADR(Buf[0]);
undoBuffer := ADR(UBuf);
bufferPos := 0; dispPos := 0;
maxChars := 30;
longInt := 0;
END; (*WITH*)
(*-------------------------------------------------------*)
WITH Gadgets[4] DO
nextGadget := ADR(Gadgets[5]);
leftEdge := 162;
topEdge := 37;
width := 219;
height := 8;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := strGadget ;
gadgetRender := ADR(Borders[7]);
selectRender := NIL;
gadgetText := ADR(GText[4]);
specialInfo := ADR(SInfo[1]);
gadgetID := 4;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[4] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := -139; topEdge := 0;
iTextFont := NIL;
iText := ADR('Straße');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[7] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[7]);
nextBorder := NIL;
END; (*WITH*)
XY[7,0] := 0; XY[7,1] := 0;
XY[7,2] := 222; XY[7,3] := 0;
XY[7,4] := 222; XY[7,5] := 11;
XY[7,6] := 0; XY[7,7] := 11;
XY[7,8] := 0; XY[7,9] := 0;
(* String-Info *)
WITH SInfo[1] DO
buffer := ADR(Buf[1]);
undoBuffer := ADR(UBuf);
bufferPos := 0; dispPos := 0;
maxChars := 30;
longInt := 0;
END; (*WITH*)
(*-------------------------------------------------------*)
WITH Gadgets[5] DO
nextGadget := ADR(Gadgets[6]);
leftEdge := 162;
topEdge := 52;
width := 44;
height := 8;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate,stringRight,longint};
gadgetType := strGadget ;
gadgetRender := ADR(Borders[8]);
selectRender := NIL;
gadgetText := ADR(GText[5]);
specialInfo := ADR(SInfo[2]);
gadgetID := 5;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[5] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := -137; topEdge := 1;
iTextFont := NIL;
iText := ADR('Postleitzahl');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[8] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[8]);
nextBorder := NIL;
END; (*WITH*)
XY[8,0] := 0; XY[8,1] := 0;
XY[8,2] := 47; XY[8,3] := 0;
XY[8,4] := 47; XY[8,5] := 11;
XY[8,6] := 0; XY[8,7] := 11;
XY[8,8] := 0; XY[8,9] := 0;
(* String-Info *)
WITH SInfo[2] DO
buffer := ADR(Buf[2]);
undoBuffer := ADR(UBuf);
bufferPos := 0; dispPos := 0;
maxChars := 5;
longInt := 0;
END; (*WITH*)
(*-------------------------------------------------------*)
WITH Gadgets[6] DO
nextGadget := ADR(Gadgets[7]);
leftEdge := 162;
topEdge := 67;
width := 219;
height := 8;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := strGadget ;
gadgetRender := ADR(Borders[9]);
selectRender := NIL;
gadgetText := ADR(GText[6]);
specialInfo := ADR(SInfo[3]);
gadgetID := 6;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[6] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := -136; topEdge := 1;
iTextFont := NIL;
iText := ADR('Wohnort');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[9] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[9]);
nextBorder := NIL;
END; (*WITH*)
XY[9,0] := 0; XY[9,1] := 0;
XY[9,2] := 222; XY[9,3] := 0;
XY[9,4] := 222; XY[9,5] := 11;
XY[9,6] := 0; XY[9,7] := 11;
XY[9,8] := 0; XY[9,9] := 0;
(* String-Info *)
WITH SInfo[3] DO
buffer := ADR(Buf[3]);
undoBuffer := ADR(UBuf);
bufferPos := 0; dispPos := 0;
maxChars := 30;
longInt := 0;
END; (*WITH*)
(*-------------------------------------------------------*)
WITH Gadgets[7] DO
nextGadget := NIL;
leftEdge := 162;
topEdge := 82;
width := 93;
height := 8;
flags := GadgetFlagSet{};
activation := ActivationFlagSet{relVerify,gadgImmediate};
gadgetType := strGadget ;
gadgetRender := ADR(Borders[10]);
selectRender := NIL;
gadgetText := ADR(GText[7]);
specialInfo := ADR(SInfo[4]);
gadgetID := 7;
userData := NIL;
END; (*WITH*)
(* Gadget-Text *)
WITH GText[7] DO
frontPen := 1; backPen := 0;
drawMode := jam2;
leftEdge := -135; topEdge := 0;
iTextFont := NIL;
iText := ADR('Geburtsdatum');
nextText := NIL;
END; (*WITH*)
(* Gadget-Border(s) *)
WITH Borders[10] DO
leftEdge := -2; topEdge := -2;
frontPen := 1; backPen := 0;
drawMode := jam2;
count := 5;
xy := ADR(XY[10]);
nextBorder := NIL;
END; (*WITH*)
XY[10,0] := 0; XY[10,1] := 0;
XY[10,2] := 96; XY[10,3] := 0;
XY[10,4] := 96; XY[10,5] := 11;
XY[10,6] := 0; XY[10,7] := 11;
XY[10,8] := 0; XY[10,9] := 0;
(* String-Info *)
WITH SInfo[4] DO
buffer := ADR(Buf[4]);
undoBuffer := ADR(UBuf);
bufferPos := 0; dispPos := 0;
maxChars := 11;
longInt := 0;
END; (*WITH*)
(*-------------------------------------------------------*)
(* Fenster öffnen: *)
IF (wptr = NIL) THEN
WPtr := OpenWindow (GadgWindow);
wptr := WPtr;
ELSE
Pos := AddGList (wptr,ADR(Gadgets[0]),0,8,NIL);
RefreshGList (ADR(Gadgets[0]),wptr,NIL,8);
WPtr := wptr;
END; (*IF*)
END InitReq2;
(*--------------------------------------------------------------------------*)
PROCEDURE CloseReq2;
(* Schließen des Gadget-Windows. *)
BEGIN
IF (WPtr#NIL) THEN CloseWindow (WPtr) END;
END CloseReq2;
(*--------------------------------------------------------------------------*)
PROCEDURE GetReq2GPtr (ID : INTEGER) : ADDRESS;
(* Liefert den GadgetPtr des Gadgets mit der angegebenen ID. *)
BEGIN
RETURN ADR(Gadgets[ID]);
END GetReq2GPtr;
(*--------------------------------------------------------------------------*)
BEGIN
WPtr := NIL;
END Req2.